<?php

/* -----------------------------------------------------------------
 * 	$Id: blog_edit_block.php 1113 2014-06-19 11:32:53Z akausch $
 * 	Copyright (c) 2011-2021 commerce:SEO by Webdesign Erfurt
 * Copyright by H&S eCom 
 * @author little Pit(S.B.)
 * 	http://www.commerce-seo.de : www.indiv-style.de
 * ------------------------------------------------------------------
 * 	based on:
 * 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
 * 	(c) 2002-2003 osCommerce - www.oscommerce.com
 * 	(c) 2003     nextcommerce - www.nextcommerce.org
 * 	(c) 2005     xt:Commerce - www.xt-commerce.com
 * 	Released under the GNU General Public License
 * --------------------------------------------------------------- */

require_once ('includes/application_top.php');
require_once ('includes/application_blog.php');
require_once (DIR_FS_ADMIN . 'includes/classes/class.blog.php');
require_once (DIR_FS_ADMIN . 'includes/classes/class.image_manipulator_gd2.php');
require_once(DIR_FS_INC . 'xtc_parse_input_field_data.inc.php');
$coo_text_mgr = new LanguageTextManager('blog', $_SESSION['languages_id']);
$language = xtc_get_languages();

$module_smarty = new Smarty;
$module_smarty->assign('txt', $coo_text_mgr->v_section_content_array['blog']);

if (isset($_POST['deletmycomments']) && $_POST['deletmycomments'] == 'delete' && isset($_POST['com_id']) && $_POST['com_id'] != '') {
    xtc_db_query("delete from " . TABLE_BLOG_COMCOM . " where id = " . $_POST['com_id'] . " ");
    xtc_redirect('blog.php?action=comments');
}

//Block speichern
if (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Artikel') {
    foreach ($language AS $lang) {
        $artname = xtc_db_fetch_array(xtc_db_query("select products_name from products_description where products_id = " . $_POST['artikel'] . " and language_id = " . $lang['id'] . "  "));
        $art_sql_data = array(
            'art_id' => $_POST['artikel'],
            'language_id' => $lang['id'],
            'position' => $_POST['aposition'],
            'name' => $artname['products_name']
        );
        xtc_db_perform(TABLE_BLOG_ITEMART, $art_sql_data, 'update', "art_id = '" . $_POST['oldid'] . "' and language_id = '" . $lang['id'] . "' ");
    }
    xtc_redirect('blog.php?action=edit_item&cat=' . $_POST['cat'] . '&item=' . $_POST['item_id']);
} elseif (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Blogbeitrag') {
    foreach ($language AS $lang) {
        $artname = xtc_db_fetch_array(xtc_db_query("select name from blog_items where item_id = " . $_POST['blogitem'] . " and language_id = " . $lang['id'] . "  "));
        $art_sql_data = array(
            'bitem_id' => $_POST['blogitem'],
            'language_id' => $lang['id'],
            'position' => $_POST['biposition'],
            'name' => $artname['name']
        );
        xtc_db_perform(TABLE_BLOG_ITEMITEM, $art_sql_data, 'update', "bitem_id = '" . $_POST['oldid'] . "' and language_id = '" . $lang['id'] . "' ");
    }
    xtc_redirect('blog.php?action=edit_item&cat=' . $_POST['cat'] . '&item=' . $_POST['item_id']);
} elseif (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Kategorie') {
    foreach ($language AS $lang) {
        $artname = xtc_db_fetch_array(xtc_db_query("select categories_name from categories_description where categories_id = " . $_POST['kategorie'] . " and language_id = " . $lang['id'] . "  "));
        $art_sql_data = array(
            'kat_id' => $_POST['kategorie'],
            'language_id' => $lang['id'],
            'position' => $_POST['kposition'],
            'name' => $artname['categories_name']
        );
        xtc_db_perform(TABLE_BLOG_ITEMKAT, $art_sql_data, 'update', "kat_id = '" . $_POST['oldid'] . "' and language_id = '" . $lang['id'] . "' ");
    }
    xtc_redirect('blog.php?action=edit_item&cat=' . $_POST['cat'] . '&item=' . $_POST['item_id']);
} elseif (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Text') {
    foreach ($language AS $lang) {
        $art_sql_data = array(
            'tblock_id' => $_POST['oldid'],
            'language_id' => $lang['id'],
            'position' => $_POST['tposition'],
            'description' => $_POST['emydesc_' . $lang['id']]
        );
        xtc_db_perform(TABLE_BLOG_ITEMTEXT, $art_sql_data, 'update', "tblock_id = '" . $_POST['oldid'] . "' and language_id = '" . $lang['id'] . "' ");
    }
    xtc_redirect('blog.php?action=edit_item&cat=' . $_POST['cat'] . '&item=' . $_POST['item_id']);
} elseif (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Comment') {
    $art_sql_data = array(
        'com_id' => $_POST['item_id'],
        'description' => $_POST['comdesc'],
        'date' => date('d.m.Y')
    );
    xtc_db_perform(TABLE_BLOG_COMCOM, $art_sql_data);
    xtc_redirect('blog.php?action=comments');
} elseif (isset($_POST['safe']) && $_POST['safe'] != '' && $_POST['safe'] == 'Slider') {
    for ($i = 0; $i < PICITEM; $i++) {
        if ($mypicload = xtc_try_upload('ism_image_' . ($i + 1), DIR_FS_CATALOG_IMAGES . 'blog_image/original_images/')) {
            xtc_db_query("DELETE from " . TABLE_BLOG_ITEMIMG . " where slid_id = '" . $_POST['oldid'] . "' and image_nr = '" . ($i + 1) . "' ");
            $sql_images_array = array(
                'item_id' => xtc_db_prepare_input($_POST['item_id']),
                'slid_id' => xtc_db_prepare_input($_POST['oldid']),
                'image_nr' => ($i + 1),
                'width' => xtc_db_prepare_input($_POST['width']),
                'position' => xtc_db_prepare_input($_POST['slposition']),
                'height' => xtc_db_prepare_input($_POST['height']),
                'floating' => xtc_db_prepare_input($_POST['floating']),
                'image' => xtc_db_prepare_input($mypicload->filename)
            );
            xtc_db_perform(TABLE_BLOG_ITEMIMG, $sql_images_array);
            $products_image_name = $mypicload->filename;
            require (DIR_WS_INCLUDES . 'blog_info_images.php');
            require (DIR_WS_INCLUDES . 'blog_popup_images.php');
            require (DIR_WS_INCLUDES . 'blog_thumbnail_images.php');
        } else {
            $sql_images_array = array(
                'item_id' => xtc_db_prepare_input($_POST['item_id']),
                'slid_id' => xtc_db_prepare_input($_POST['oldid']),
                'image_nr' => ($i + 1),
                'width' => xtc_db_prepare_input($_POST['width']),
                'position' => xtc_db_prepare_input($_POST['slposition']),
                'height' => xtc_db_prepare_input($_POST['height']),
                'floating' => xtc_db_prepare_input($_POST['floating']),
                'image' => xtc_db_prepare_input($_POST['ismv_image_' . ($i + 1)])
            );
            xtc_db_perform(TABLE_BLOG_ITEMIMG, $sql_images_array, 'update', "image_nr = '" . ($i + 1) . "' and slid_id = '" . $_POST['oldid'] . "' ");
        }
    }
    for ($i = 0, $groesse = count($_POST['imageremove']); $i < $groesse; ++$i) {
        xtc_db_query("DELETE from " . TABLE_BLOG_ITEMIMG . " where slid_id = '" . $_POST['oldid'] . "' and image = '" . $_POST['imageremove'][$i] . "' ");
        @xtc_del_image_file($_POST['imageremove'][$i]);
        if (file_exists(DIR_WS_CATALOG_IMAGES . 'blog_image/thumbnail_images/' . $_POST['imageremove'][$i])) {
            @unlink(DIR_WS_CATALOG_IMAGES . 'blog_image/thumbnail_images/' . $_POST['imageremove'][$i]);
        }
    }
    xtc_db_query("DELETE from " . TABLE_BLOG_ITEMIMG . " where image = '' ");
    xtc_redirect('blog.php?action=edit_item&cat=' . $_POST['cat'] . '&item=' . $_POST['item_id']);
}


//Block löschen
if (isset($_GET['deleteblock']) && $_GET['deleteblock'] != '' && isset($_GET['item']) && $_GET['item'] != '' && isset($_GET['typ']) && $_GET['typ'] != '') {
    if ($_GET['typ'] == 'Artikel') {
        xtc_db_query("delete from " . TABLE_BLOG_ITEMART . " where art_id = " . $_GET['deleteblock'] . " and item_id = " . $_GET['item'] . " ");
    } elseif ($_GET['typ'] == 'Textarea') {
        xtc_db_query("delete from " . TABLE_BLOG_ITEMTEXT . " where tblock_id = " . $_GET['deleteblock'] . " and item_id = " . $_GET['item'] . " ");
    } elseif ($_GET['typ'] == 'Kategorie') {
        xtc_db_query("delete from " . TABLE_BLOG_ITEMKAT . " where kat_id = " . $_GET['deleteblock'] . " and item_id = " . $_GET['item'] . " ");
    } elseif ($_GET['typ'] == 'SlideShow') {
        xtc_db_query("delete from " . TABLE_BLOG_ITEMIMG . " where slid_id = " . $_GET['deleteblock'] . " and item_id = " . $_GET['item'] . " ");
    } elseif ($_GET['typ'] == 'Blogbeitrag') {
        xtc_db_query("delete from " . TABLE_BLOG_ITEMITEM . " where bitem_id = " . $_GET['deleteblock'] . " and item_id = " . $_GET['item'] . " ");
    } else {
        
    }
//Block bearbeiten
} elseif (isset($_GET['updateblock']) && $_GET['updateblock'] != '' && isset($_GET['typ']) && $_GET['typ'] != '') {
    if ($_GET['typ'] == 'Artikel') {
        $myart_query2 = xtc_db_query("select * from " . TABLE_BLOG_ITEMART . " where art_id = " . $_GET['updateblock'] . " ");
        $myart = xtc_db_fetch_array($myart_query2);
        $myart_query = xtc_db_query("select cd.*, ca.products_id as cid, ca.products_image, ca.products_status from products ca, products_description cd where cd.products_id = ca.products_id and cd.language_id = '" . $_SESSION['languages_id'] . "' and ca.products_status = '1' ");
        $selart[0] = array('id' => '0', 'text' => 'Alle');
        $i = 1;
        $caterlaubt_query = xtc_db_query("select art_id from " . TABLE_BLOG_ITEMART . " where language_id = " . $_SESSION['languages_id'] . " and item_id = '" . $myart['item_id'] . "' ");
        $r = 0;
        while ($caterlaubt = xtc_db_fetch_array($caterlaubt_query)) {
            $cater[$r] = $caterlaubt['art_id'];
            $r++;
        }
        while ($selbart = xtc_db_fetch_array($myart_query)) {
            if (!in_array($selbart['cid'], $cater) || $selbart['cid'] == $_GET['updateblock']) {
                $selart[$i] = array(
                    'id' => $selbart['cid'],
                    'text' => $selbart['products_name']
                );
            }
            $i++;
        }

        $module_smarty->assign('ITEM', $myart['item_id']);
        $module_smarty->assign('FORM', xtc_draw_form('artikel', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
        $module_smarty->assign('APOS', xtc_draw_input_field('aposition', $myart['position']));
        $module_smarty->assign('MEART', xtc_draw_pull_down_menu('artikel', $selart, $_GET['updateblock'], ''));
        $module_smarty->assign('cat', $_GET['cat']);
        $module_smarty->assign('oldid', $_GET['updateblock']);
        $module_smarty->assign('FORM_END', '</form>');
        $module_smarty->assign('language', $_SESSION['language']);
        $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $module_smarty->caching = false;
        $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
        $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
        $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_art_edit.html');
    } elseif ($_GET['typ'] == 'Blogbeitrag') {
        $myitem_query2 = xtc_db_query("select * from " . TABLE_BLOG_ITEMITEM . " where bitem_id = " . $_GET['updateblock'] . " ");
        $myitem = xtc_db_fetch_array($myitem_query2);
        $myitem_query = xtc_db_query("select * from blog_items where language_id = '" . $_SESSION['languages_id'] . "' and status = '2' ");
        $selitem[0] = array('id' => '0', 'text' => 'Alle');
        $i = 1;
        $caterlaubt_query = xtc_db_query("select bitem_id from " . TABLE_BLOG_ITEMITEM . " where language_id = " . $_SESSION['languages_id'] . " and item_id = '" . $myitem['item_id'] . "' ");
        $r = 0;
        while ($caterlaubt = xtc_db_fetch_array($caterlaubt_query)) {
            $cater[$r] = $caterlaubt['bitem_id'];
            $r++;
        }
        while ($selbart = xtc_db_fetch_array($myitem_query)) {
            if (!in_array($selbart['item_id'], $cater) || $selbart['item_id'] == $_GET['updateblock']) {
                $selart[$i] = array(
                    'id' => $selbart['item_id'],
                    'text' => $selbart['name']
                );
            }
            $i++;
        }

        $module_smarty->assign('ITEM', $myitem['item_id']);
        $module_smarty->assign('FORM', xtc_draw_form('blogitem', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
        $module_smarty->assign('BIPOS', xtc_draw_input_field('biposition', $myitem['position']));
        $module_smarty->assign('MEBART', xtc_draw_pull_down_menu('blogitem', $selart, $_GET['updateblock'], ''));
        $module_smarty->assign('cat', $_GET['cat']);
        $module_smarty->assign('oldid', $_GET['updateblock']);
        $module_smarty->assign('FORM_END', '</form>');
        $module_smarty->assign('language', $_SESSION['language']);
        $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $module_smarty->caching = false;
        $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
        $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
        $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_bitem_edit.html');
    } elseif ($_GET['typ'] == 'Textarea') {
        for ($i = 0, $n = sizeof($language); $i < $n; $i++) {
            $items_query = xtc_db_query("SELECT
														*
													FROM
														" . TABLE_BLOG_ITEMTEXT . "
													WHERE
														language_id = '" . (int) $language[$i]['id'] . "'
													AND
														tblock_id = '" . (int) $_GET['updateblock'] . "' ");
            $items = xtc_db_fetch_array($items_query);
            $field_tdesc = xtc_draw_textarea_field('emydesc_' . $language[$i]['id'], '', '100', '50', $items['description'], 'class="ckeditor" name="editor2"');
            if (USE_WYSIWYG == 'true') {
                $field_sdesc_wy = '1';
            } else {
                $field_sdesc_wy = '0';
            }
            $itemedit2[$i] = array(
                'id' => (int) $_GET['item'],
                'items' => $items['item_id'],
                'langid' => $language[$i]['id'],
                'langname' => $language[$i]['name'],
                'position' => $items['position'],
                'field_mydesc' => $field_tdesc,
                'field_sdesc_wy' => $field_sdesc_wy
            );
        }

        $module_smarty->assign('ITEM', $itemedit2[0]['items']);
        $module_smarty->assign('cat', $_GET['cat']);
        $module_smarty->assign('oldid', $_GET['updateblock']);
        $module_smarty->assign('FORM', xtc_draw_form('artikel', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
        $module_smarty->assign('ITEM_EDIT', $itemedit2);
        $module_smarty->assign('TPOS', xtc_draw_input_field('tposition', $itemedit2[0]['position']));
        $module_smarty->assign('FORM_END', '</form>');
        $module_smarty->assign('language', $_SESSION['language']);
        $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $module_smarty->caching = false;
        $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
        $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
        $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_text_edit.html');
    } elseif ($_GET['typ'] == 'Kategorie') {
        $myart_query = xtc_db_query("select * from " . TABLE_BLOG_ITEMKAT . " where kat_id = " . $_GET['updateblock'] . " ");
        $myart = xtc_db_fetch_array($myart_query);
        $mykats_query = xtc_db_query("select cd.*, ca.categories_id as cid, ca.categories_image, ca.categories_status from categories ca, categories_description cd where cd.categories_id = ca.categories_id and cd.language_id = '" . $_SESSION['languages_id'] . "' and ca.categories_status = '1' ");
        $selkat[0] = array('id' => '0', 'text' => 'Alle');
        $i = 1;
        $caterlaubt_query = xtc_db_query("select kat_id from " . TABLE_BLOG_ITEMKAT . " where language_id = " . $_SESSION['languages_id'] . " and item_id = '" . $myart['item_id'] . "' ");
        $r = 0;
        while ($caterlaubt = xtc_db_fetch_array($caterlaubt_query)) {
            $cater[$r] = $caterlaubt['kat_id'];
            $r++;
        }
        while ($selbkat = xtc_db_fetch_array($mykats_query)) {
            if (!in_array($selbkat['cid'], $cater) || $selbkat['cid'] == $_GET['updateblock']) {
                $selkat[$i] = array(
                    'id' => $selbkat['cid'],
                    'text' => $selbkat['categories_name']
                );
            }
            $i++;
        }
        $module_smarty->assign('ITEM', $myart['item_id']);
        $module_smarty->assign('FORM', xtc_draw_form('kategorie', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
        $module_smarty->assign('MEKATS', xtc_draw_pull_down_menu('kategorie', $selkat, $_GET['updateblock']));
        $module_smarty->assign('KPOS', xtc_draw_input_field('kposition', $myart['position']));
        $module_smarty->assign('cat', $_GET['cat']);
        $module_smarty->assign('oldid', $_GET['updateblock']);
        $module_smarty->assign('FORM_END', '</form>');
        $module_smarty->assign('language', $_SESSION['language']);
        $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $module_smarty->caching = false;
        $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
        $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
        $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_kat_edit.html');
    } elseif ($_GET['typ'] == 'SlideShow') {
        $myimages = xtc_get_blog_mo_images($_GET['updateblock']);
        for ($i = 0; $i < PICITEM; $i++) {
            $Bildnummer = TEXT_PRODUCTS_IMAGE . ' ' . ($i + 1);
            $bildda = $myimages[$i];
            $Bild = xtc_image(DIR_WS_CATALOG_IMAGES . 'blog_image/thumbnail_images/' . $myimages[$i]['image'], 'is_images_' . ($i + 1));
            $Bildfeld = xtc_draw_file_field('ism_image_' . ($i + 1)) . '<br />' . $myimages[$i]['image'] . xtc_draw_hidden_field('ismv_image_' . ($i + 1), $myimages[$i]['image']);
            $Bildfeld2 = xtc_draw_selection_field('imageremove[]', 'checkbox', $myimages[$i]['image']) . ' ' . TEXT_DELETE;
            $Bildfeld3 = xtc_draw_file_field('ism_image_' . ($i + 1)) . xtc_draw_hidden_field('ismv_image_' . ($i + 1), $myimages[$i]['image']);

            $bilder[$i] = array(
                'bildfeld0' => $bildda,
                'bildfeld1' => $Bildnummer,
                'bildfeld2' => $Bild,
                'bildfeld3' => $Bildfeld,
                'bildfeld4' => $Bildfeld2,
                'bildfeld5' => $Bildfeld3
            );
        }
        $bilder2 = '';
        $bilder2['width'] .= xtc_draw_input_field('width', $myimages[0]['width']);
        $bilder2['height'] .= xtc_draw_input_field('height', $myimages[0]['height']);
        $bilder2['floating'] .= xtc_draw_input_field('floating', $myimages[0]['floating']);
        $bilder2['position'] .= xtc_draw_input_field('slposition', $myimages[0]['position']);
        $module_smarty->assign('ITEM', $myimages[0]['item_id']);
        $module_smarty->assign('FORM', xtc_draw_form('slideimages', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
        $module_smarty->assign('BILDER2', $bilder2);
        $module_smarty->assign('BILDER', $bilder);
        $module_smarty->assign('cat', $_GET['cat']);
        $module_smarty->assign('oldid', $_GET['updateblock']);
        $module_smarty->assign('FORM_END', '</form>');
        $module_smarty->assign('language', $_SESSION['language']);
        $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $module_smarty->caching = false;
        $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
        $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
        $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_image_edit.html');
    }
}
if (isset($_GET['actionset']) && $_GET['actionset'] == 'deleteconfirm' && isset($_GET['rdID']) && $_GET['rdID'] != '' && isset($_GET['action']) && $_GET['action'] == 'comments') {
    xtc_db_query("delete from " . TABLE_BLOG_COMMENT . " where id = '" . $_GET['rdID'] . "'");
    xtc_redirect('blog.php?action=comments');
}
if (isset($_GET['updatecomment'])) {
    $field_tdesc = xtc_draw_textarea_field('comdesc', '', '85', '10', '', '');
    $module_smarty->assign('TEXT', $field_tdesc);
    $module_smarty->assign('ITEM', $_GET['updatecomment']);
    $module_smarty->assign('FORM', xtc_draw_form('artikel', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
    $module_smarty->assign('FORM_END', '</form>');
    $module_smarty->assign('language', $_SESSION['language']);
    $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
    $module_smarty->caching = false;
    $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
    $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
    $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_comment_edit.html');
}
if (isset($_GET['editcomment'])) {
    $rID = xtc_db_prepare_input($_GET['rID']);
    $reviews = xtc_db_fetch_array(xtc_db_query("SELECT * FROM " . TABLE_BLOG_COMMENT . " WHERE id = '" . xtc_db_input($rID) . "';"));
    $module_smarty->assign('FORM', xtc_draw_form('artikel', 'blog_edit_block.php', '', 'post', 'enctype="multipart/form-data"'));
	$module_smarty->assign('FORM_END', '</form>');
    $field_tdesc = xtc_draw_textarea_field('reviews_text', 'soft', '60', '15', $reviews['text']);
    $module_smarty->assign('NAME', xtc_draw_input_field('name' , $reviews['text']));
    $module_smarty->assign('TEXT', $field_tdesc);
    $module_smarty->assign('language', $_SESSION['language']);
    $module_smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
    $module_smarty->caching = false;
    $module_smarty->template_dir = DIR_FS_CATALOG . 'admin/templates/';
    $module_smarty->compile_dir = DIR_FS_CATALOG . 'admin/templates_c';
    $module_smarty->display(CURRENT_ADMIN_TEMPLATE . '/blog_comment_edit.html');
}
require(DIR_WS_INCLUDES . 'application_bottom.php');
